{% extends "base_16_8.html" %}

{% block title %}{{ post.title }}{% endblock %}

{% block h1 %}{{ post.title }}{% endblock %}

{% block extra-js %}
<script type="text/javascript" src="/media/js/post/read.js"></script>
{% endblock %}

<!-- left -->
{% block left %}
    <div class="grid_2 alpha">
        <a href="/people/{{ post.author.username }}/">
            <img src="{{ post.author.userpic.spic }}" alt="没有头像" title="进入TA的主页">&nbsp;</a>        
    </div>
    
    <div class="grid_13 omega">
        <h4><a href="/people/{{ post.author.username }}">{{ post.author.first_name }}</a>
            <span class="gray">&nbsp;发表于 {{ post.createdtime|date:"Y-m-d H:i" }}</span>
        </h4>
        <div class="note marginleft grid_12 alpha">{{ post.content|urlize }}</div>
        {% ifequal post.author user %}
            <div class="clear"></div><br>
            <div class="grid_13 alpha omega">
                <div class="grid_2 prefix_11 alpha omega">
                    <a class="gray" href="/post/{{ post.id }}/update/">&gt; 修改</a>
                </div>                
            </div>
        {% endifequal %}
    </div>
    <div class="clear"></div><br><br>
       
    <div id="commentlist" class="grid_13 prefix_2 alpha omega">
        {% for comment in commentlist.object_list %}
        <div class="commentdiv grid_13 alpha omega">
            <div class="grid_2 alpha">
                <a href="/people/{{ comment.author.username }}/">
                    <img src="{{ comment.author.userpic.spic }}" alt="没有头像" title="进入TA的主页">&nbsp;</a>
            </div>
            
            <div class="grid_11 omega ">
                <h4><span class="gray">{{ comment.createdtime|date:"Y-m-d H:i" }}</span></h4>
                <div class="note marginleft grid_10 alpha">{{ comment.content|urlize  }}</div>
            </div>
            
            {% if comment.author == user %}
                <div class="clear"></div>
                <div class="grid_13 alpha omega">
                    <div class="grid_2 alpha prefix_11">
                        <a class="delete" href="/comment/{{ comment.id }}/delete/">&gt; 删除</a>
                    </div>           
                </div>
            {% endif %}
            <div class="clear"></div><br>
        </div>
        {% endfor %}
        
    <div class="clear"></div><br><br>
    
        <div style="text-align:center" class="grid_12 alpha omega" >
            {% with commentlist as list %}
                {% include "tool/pagenator.html" %}
            {% endwith %}
        </div>
        
    </div>
    
<div class="clear"></div><br>
    
    <div class="grid_13 prefix_2 alpha">
    {% if user.is_authenticated %}
        <form id="comment" action="/post/{{ post.id }}/comment/create/" method="post">
            <h5>回复：</h5>
            {{ commentform.content }}
            <br>
            <input class="button" type="submit" value="就这样吧">
            <span class="error" name="content" style="display:none"></span>
            
        </form>
    {% else %}
        <a href="{% url apps.account.views.xnlogin %}">&gt; 登录后才能回复</a>
    {% endif %}    
    </div>

{% endblock %}<!-- left -->
    

{% block right %}
{% include "activity/sideinfo.html" %}
<br><br>
<a href="{{ master.get_absolute_url }}post/">&gt; 返回活动论坛</a>
{% endblock %}<!-- right -->
